import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";

export function dailyStatus(query) {
  return request({
    url: '/worklog/log/list',
    method: 'get',
    params: query
  })
}

export function dailyStatusById(data) {
  return request({
    url: '/worklog/log/list',
    method: 'post',
    contentType: "application/json",
    data: data
  })
}

export function saveHours(data) {
  return request({
    url: '/worklog/log/add',
    method: 'post',
    data: data
  })
}


export function saveLog(data) {
  return request({
    url: '/putdailylog',
    method: 'post',
    data: data
  })
}

export function getprojectname(data) {
  return request({
    url: '/worklog/project/list',
    method: 'get',
    data: data
  })
}


export function getuserinfo(data) {
  return request({
    url: '/getInfo',
    method: 'get',
  })
}

//新增项目
export function addnewproject(data) {
  return request({
    url: '/worklog/project',
    method: 'post',
    data: data
  })
}

//获得当前用户项目
export function getprojectlist() {
  return request({
    url: '/system/user/profile/userProject',
    method: 'get',
  })
}

//删除项目
export function deleteproject(data) {
  return request({
    url: '/worklog/project/' + data,
    method: 'delete',
  })
}

//添加项目成员
export function addselectuser(data) {
  return request({
    url: '/worklog/staffAndProject/add',
    method: 'post',
    data: data
  })
}

//获取项目角色
export function getuserrole(data) {
  return request({
    url: '/worklog/staffAndProject/getinfo',
    method: 'post',
    data: data
  })
}
//通过项目id获取该项目下的员工
export function getprojectstaff(data) {
  return request({
    url: '/worklog/staffAndProject/staffids/' + data,
    method: 'get',

  })
}

//将员工移除项目
export function deleteprojectstaff(data) {
  return request({
    url: '/worklog/staffAndProject/delete',
    method: 'delete',
    data: data
  })
}


//获取所有日报
export function getalllog() {
  return request({
    url: '/worklog/log/list',
    method: 'get',
  })
}

//获取所有日报
export function getprojectbylogid(data) {
  return request({
    url: '/worklog/log/' + data,
    method: 'get',
  })
}

//修改日报
export function deletelog(data) {
  return request({
    url: '/worklog/log/delete/'+data,
    method: 'delete',
  })
}


//通过组长id获取组员id

export function getmember(data) {
  return request({
    url: '/worklog/leaderAndMember/Memberids/'+data,
  })
}

